package com.wontube.smr.remote.admin;

import com.wontube.client.modle.vo.PagenateInfo;
import com.wontube.core.annotation.NoLoginSupport;
import com.wontube.core.cache.Cacher;
import com.wontube.core.pub.servlet.handlers.BasicHandler;
import com.wontube.smr.client.fs.IMp3SearchHandler;
import com.wontube.smr.dao.bo.KeywordFilterDao;
import com.wontube.smr.web.client.admin.IAdminNocopyHandler;
import com.wontube.smr.web.client.model.po.KeywordNocopy;
import com.wontube.smr.web.client.model.vo.KeywordNocopyItems;

/**
 * @author tanggf(2012-7-10)
 *
 */
@NoLoginSupport
public class AdminNocopyHandler  extends BasicHandler implements IAdminNocopyHandler{

	@Override
	public KeywordNocopyItems listKeywordNocopies(String keyType,
			PagenateInfo pageInfo) {
		return KeywordFilterDao.listKeywordNocopy(keyType, pageInfo);
	}

	@Override
	public Integer addKeywordNocopy(KeywordNocopy nocopy) {
		return KeywordFilterDao.addKeywordNocopy(nocopy);
	}

	@Override
	public Integer deleteKeywordNocopy(String id) {
		return KeywordFilterDao.deleteKeywordNocopy(id);
	}

	/* 
	 * @see com.wontube.smr.web.client.admin.IAdminNocopyHandler#deleteCache()
	 */
	@Override
	public boolean deleteCache() {
		String clazzName = IMp3SearchHandler.class.getName();
		Cacher.defaultCacher.deleteAllCache(clazzName, "search", 2);
		
		return true;
	}
}
